package test.junit;

import java.util.List;

import junit.framework.TestCase;

import com.hacoc.common.util.SpringUtil;
import com.hacoc.countdown.dao.CountDownDAO;
import com.hacoc.countdown.model.UserInfo;


public class DaoTester extends TestCase {

    CountDownDAO countDownDAO;

    private static final String[] xmls = {"countDownContext.xml", "countDownDatabase.xml", "countDownDAOs.xml"};

	/**
	 * Constructor for DaoTester.
	 * @param arg0
	 */
	public DaoTester(String arg0) {
		super(arg0);
	}

	public static void main(String[] args) {
		junit.textui.TestRunner.run(DaoTester.class);
	}

	/*
	 * @see TestCase#setUp()
	 */
	protected void setUp() throws Exception {
		super.setUp();

		countDownDAO = (CountDownDAO)
               SpringUtil.getSpringContext(xmls).getBean("countDownDAO");

	}

	public void testAny() throws Exception {
		List list = countDownDAO.findUserInfoByUserId("0000000000");
		System.out.println("size="+list.size());
		for(int i=0;i<list.size();i++){
			UserInfo cd = (UserInfo)list.get(i);
			System.out.println(cd.getUserId()+"="+cd.getUserName());
		}
	}
}

